package main

import (
	"context"
	"fmt"
	"google.golang.org/grpc"
	"log"
	"mxshop_srvs/proto"
)

const (
	address = "localhost:50001"
	//defaultName = "world"
)

func main() {

	client, err := grpc.Dial(address, grpc.WithInsecure())
	if err != nil {
		log.Println("grpc dail err:", err)
	}

	defer client.Close()

	c := proto.NewUserClient(client)

	ul, _ := c.GetUserList(context.Background(), &proto.PageInfo{
		Pn:    2,
		PSize: 5,
	})

	if ul == nil {
		fmt.Println("ul is null")
	} else {
		fmt.Println("not null", ul)
	}

}
